跳到主要内容

文本转语音 / TTS

OpenAPI Specification

openapi: 3.0.1
info:
title: ''
description: ''
version: 1.0.0
paths:
/v1/audio/speech:
post:
summary: 文本转语音 / TTS
deprecated: false
description: ''
tags:
- 模型接口/Google Gemini/OpenAI兼容接口(推荐)
parameters:
- name: Accept
in: header
description: ''
required: true
example: application/json
schema:
type: string
default: application/json
- name: Authorization
in: header
description: ''
required: true
example: sk-
schema:
type: string
default: sk-
requestBody:
content:
application/json:
schema:
type: object
properties:
model:
type: string
description: 可用的 TTS 模型之一:tts-1 或 tts-1-hd
input:
type: string
description: 要生成音频的文本。最大长度为4096个字符。
voice:
type: string
description: 生成音频时使用的语音。支持的语音有:alloy、echo、fable、onyx、nova 和 shimmer。
response_format:
type: string
description: 默认为 mp3 音频的格式。支持的格式有:mp3、opus、aac 和 flac。
speed:
type: string
description: 默认为 1 生成的音频速度。选择0.25到4.0之间的值。1.0是默认值。
x-apifox-orders:
- model
- input
- voice
- response_format
- speed
required:
- model
- input
- voice
- response_format
- speed
example:
model: gemini-2.5-pro-preview-tts
input: The quick brown fox jumped over the lazy dog.
voice: alloy
response_format: wav
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
01JZPP3GT5NBRK16ZCA5JCVAP2:
type: string
x-apifox-orders:
- 01JZPP3GT5NBRK16ZCA5JCVAP2
required:
- 01JZPP3GT5NBRK16ZCA5JCVAP2
headers: {}
x-apifox-name: 成功
security: []
x-apifox-folder: 模型接口/Google Gemini/OpenAI兼容接口(推荐)
x-apifox-status: released
x-run-in-apifox: https://app.apifox.com/web/project/5503894/apis/api-319592939-run
components:
schemas: {}
securitySchemes: {}
servers:
- url: '{{base_url}}'
description: 测试环境
- url: https://newapi.eronmind.com
description: 正式环境
security: []